//
//  UIBarButtonItem+Extension.swift
//  fushp_weibo
//
//  Created by fushp on 2017/11/12.
//  Copyright © 2017年 fushp. All rights reserved.
//

import UIKit
extension UIBarButtonItem {
  
    
    convenience init(imageName : String) {
        
        let btn = UIButton()
        btn.setImage(UIImage(named: imageName), for: .normal)
        btn.setImage(UIImage(named: imageName + "_highlighted"), for: .highlighted)
        btn.sizeToFit()
        
        self.init(customView : btn)
    }
    
    //uibarbuttonitem
    convenience init(title: String , fontSize: CGFloat , target: AnyObject? ,seletor:Selector) {
        let btn = UIButton.init(title: title, fontSize: fontSize , normalColor: UIColor.darkGray, highlightedColor: UIColor.orange)
        btn.addTarget(target, action: seletor, for: .touchUpInside)
        self.init(customView: btn)
    }
}
